package io.geekidea.springbootplus.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;


@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SysProduct对象", description = "商品信息")
public class SysProduct extends BaseEntity {

    private static final long serialVersionUID = -8018205544044492562L;


    @ApiModelProperty("主键")
    @NotNull(message = "ID不能为空", groups = {Update.class})
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("商品类型id")
    @NotNull(message = "商品类型id不能为空")
    private Integer categoryId;

    @ApiModelProperty("商品名称")
    @NotNull(message = "商品名称不能为空")
    private String productName;

    @ApiModelProperty("删除标记")
    @NotNull(message = "删除标记不能为空")
    private Integer deleteFlag;

    @ApiModelProperty("商品状态")
    @NotNull(message = "商品状态不能为空")
    private Integer status;

    @ApiModelProperty("市场价")
    private BigDecimal originalPrice;

    @ApiModelProperty("会员价")
    private BigDecimal memberPrice;

    @ApiModelProperty("商品库存")
    private Integer stock;

    @ApiModelProperty("商品描述")
    private String description;

    @ApiModelProperty("商品图片")
    private String images;

    @ApiModelProperty("商品主图片")
    private String masterPicUrl;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("商品标签")
    private String tags;

    @ApiModelProperty("商品关键字")
    private String keywords;

    @ApiModelProperty("商品积分")
    private Integer giftPoint;

    @ApiModelProperty("商品限制使用积分")
    private Integer usePointLimit;

    @ApiModelProperty("商品销量")
    private Integer sales;

    @ApiModelProperty("乐观锁")
    private Integer version;

    @ApiModelProperty("类别外键")
    private SysCategory sysCategory;

}
